import React from "react";
import TodoList from "./views/TodoList";
import A from "./components/A";
import { context } from "./bus/index";

class App extends React.Component {
  constructor() {
    super();
    this.state = {
      show: true,
    };
  }
  render() {
    const { show } = this.state;
    return (
      <context.Provider value={{ a: 1, b: 2 }}>
        <div className="App">
          <A></A>
          {show && <TodoList></TodoList>}
          {/* <button
            onClick={() => {
              this.setState({
                show: !show,
              });
            }}
          >
            显示隐藏
          </button> */}
        </div>
      </context.Provider>
    );
  }
}

export default App;
